﻿<?xml version="1.0"?>

		<!-- These variables define the Windows Installer product version, product code and upgrade code. They   -->
		<!-- will be used later on in this file.                                                                 -->
		<?define Property_ProductVersion = "1.0.0.1" ?>
		<?define Property_ProductCode = "{F9A7640E-ECCF-4a80-A16F-1E10E5B6BAE4}" ?>
		<?define Property_UpgradeCode = "{7E46E9B8-0637-4e45-815D-5C1E781F1D75}" ?>

		<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
			<Product Name='Guava 1.0' Id="$(var.Property_ProductCode)" UpgradeCode="$(var.Property_UpgradeCode)" Language='1033' Version="$(var.Property_ProductVersion)" Manufacturer='Microsoft Corporation'>
				<Package Id='????????-????-????-????-????????????' Keywords='Installer' Description="Guava 1.0 Installer" Comments='Guava is a registered trademark of PSU.' Manufacturer='PSU.'
				  InstallerVersion='200' Languages='1033' Compressed='yes' />

				<!-- This information enables Windows Installer major upgrade functionality so users can seamlessly  -->
				<!-- install a new version of the product and have the old version automatically uninstall behind    -->
				<!-- the scenes. See the following topic in the MSDN Library for additional information:             -->
				<!-- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/major_upgrades.asp   -->
				<Upgrade Id="$(var.Property_UpgradeCode)">
					<UpgradeVersion Minimum="$(var.Property_ProductVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />
					<UpgradeVersion Minimum="1.0.0.0" IncludeMinimum="yes" Maximum="$(var.Property_ProductVersion)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />
				</Upgrade> 

				<!-- This custom action prevents users from installing if a newer version of this product is already -->
				<!-- installed on the system. This is a part of Windows Installer major upgrade functionality.       -->
				<CustomAction Id="CA_BlockOlderVersionInstall" Error="A later version of Guava is already installed" />

				<!-- This custom action prevents users from installing this product unless Visual Studio 2005,       -->
				<!-- Visual Basic 2005 Express and/or Visual C# 2005 Express is installed. The conditions that are   -->
				<!-- checked to determine if these products are installed are defined below.                         -->
				<CustomAction Id="CA_ErrVisualStudio2005NotInstalled" Error="Guava requires Microsoft Visual Studio 2005" />

				<!-- These custom actions are used to update Visual Studio IDE registration so that it will display  -->
				<!-- the newly installed project and item templates in the IDE. Separate custom actions are defined  -->
				<!-- for the install/repair and uninstall because we want to check the return value in the install/  -->
				<!-- repair scenario and ignore the return value in the uninstall scenario. These custom actions use -->
				<!-- a set of properties that are defined below in order to find the exact location of the Visual    -->
				<!-- Studio IDE binaries (devenv.exe) on the system                -->
				<CustomAction Id="CA_Devenv_Setup_VS_Install" Property="VS2005_IDE_INSTALLED" ExeCommand="/setup" Execute="deferred" Return="check" Impersonate="no"/>


				<CustomAction Id="CA_Devenv_Setup_VS_Uninstall" Property="VS2005_IDE_INSTALLED" ExeCommand="/setup" Execute="deferred" Return="ignore" Impersonate="no"/>

				<!-- This condition adds an item to the LaunchCondition table of the MSI to block a user from        -->
				<!-- installing this product unless they have administrative privileges on the system.               -->
				<Condition Message="You must have Administrative rights on this machine to install Guava">
					<![CDATA[Privileged]]>
				</Condition>

				<!-- This is a list of directories that are used by this product as installation locations or custom -->
				<!-- action file search locations. The VS2005_ROOT_FOLDER token is defined as a property below so    -->
				<!-- that the project and item templates will be installed to the correct location even if Visual    -->
				<!-- Studio is installed to a non-default path.                                                      -->
				<!-- This is a list of directories that are used by this product as installation locations or custom -->
				<!-- action file search locations. The VS2005_ROOT_FOLDER token is defined as a property below so    -->
				<!-- that the project and item templates will be installed to the correct location even if Visual    -->
				<!-- Studio is installed to a non-default path.                                                      -->
				<Directory Id="TARGETDIR" Name="SourceDir">
					<Directory Id="ProgramFilesFolder" Name="PFiles" LongName="Program Files">
						<Directory Id='INSTALLDIR' Name='Guava' LongName='Guava 1.0'>
						<Directory Id="VS2005_ROOT_FOLDER" Name="VS8" LongName="Visual Studio 8">
							<Directory Id="Common7" Name="Common7">
								<Directory Id="IDE" Name="IDE">
									<Directory Id="ItemTemplates_VS" Name="ItemTemp" LongName="ItemTemplates">
										<Directory Id="CSharpItemTemplates_VS" Name="CSharp"/>
									</Directory>
									<Directory Id="NewFileItems_VS" Name="NewFile" LongName="NewFileItems"/>
									<Directory Id="ProjectTemplates_VS" Name="ProjTemp" LongName="ProjectTemplates">
										<Directory Id="CSharpProjectTemplates_VS" Name="CSharp">
											<Directory Id="Windows" Name="Windows" />
										</Directory>
									</Directory>
									<Directory Id="PublicAssemblies" Name="PA" LongName="PublicAssemblies">
									</Directory>
								</Directory>
							</Directory>
						</Directory>
						</Directory>
					</Directory>
				</Directory>
				<!-- This is a list of all components installed as a part of this product. A component is the        -->
				<!-- smallest atomic unit of installation in Windows Installer. Each component must have a unique    -->
				<!-- GUID. In general, it is recommended that each file be installed by a separate component in      -->
				<!-- order to avoid reference counting problems and make future servicing of this product easier.    -->
				<!-- Each component is listed as a child of the DirectoryRef that represents the directory that      -->
				<!-- the file it contains will install to. Each component is conditioned to only install if the      -->
				<!-- appropriate Visual Studio edition and features are already installed on the system.             -->

				<DirectoryRef Id="CSharpItemTemplates_VS">
					<Component Id="Component1_VS" Guid="{44047009-17B3-4825-8687-59BBF1A9F134}" DiskId="1" Transitive="yes">
						<Condition>(VS2005_INSTALLED AND VS2005_IDE_INSTALLED)</Condition>
						<File Id="GForm_VS" Name="GFormk.zip" KeyPath="yes" Source="GForm[1]_James.zip" />
					</Component>
				</DirectoryRef>
				<DirectoryRef Id="Windows"> 
					<Component Id="Component2_VS" Guid="{E659EB09-7A28-49cb-A665-557DB8DD7113}" DiskId="1" Transitive="yes">
						<Condition>(VS2005_INSTALLED AND VS2005_IDE_INSTALLED)</Condition>
						<File Id="proj_temp_VS" Name="projtemp.zip" LongName ="ProjectTemplate.zip" KeyPath="yes" Source="ProjectTemplate.zip" />
					</Component>
				</DirectoryRef>
				<DirectoryRef Id="INSTALLDIR">
					<Component Id="Component3_VS" Guid="{CDC2A6D1-A431-4ae5-8386-30ACCE1C93CC}" DiskId="1" Transitive="yes">
						<File Id="guava_dll1" Name="GData" LongName ="GuavaData.dll" KeyPath="yes" Source="GuavaData.dll" />
					</Component>
				</DirectoryRef>
				<DirectoryRef Id="INSTALLDIR">
					<Component Id="Component4_VS" Guid="{B5828971-514F-450f-A392-9E1C2BBC42BF}" DiskId="1" Transitive="yes">
						<File Id="guava_dll2" Name="GLib" LongName ="GuavaLib.dll" KeyPath="yes" Source="GuavaLib.dll" />
						<Registry Id='GuavaAssembly' Root='HKLM' Key='SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\GuavaAssembly' 
						 Type='string' Value='[INSTALLDIR]' />
					</Component>
				</DirectoryRef>

				<!-- This is a list of features that are installed as a part of this product. In this case, there is -->
				<!-- only one feature. Each feature contains a list of components that it will install. Features can -->
				<!-- can be displayed and allow user selection in setup UI if desired.                               -->

				<Feature Id="Complete" Title="Guava features" Level="1" Description="The complete Guava package" Display="expand" ConfigurableDirectory='INSTALLDIR'>
					<ComponentRef Id="Component1_VS" />
					<ComponentRef Id="Component2_VS" />
					<ComponentRef Id="Component3_VS" /> 
					<ComponentRef Id="Component4_VS" />
				</Feature>

				<!-- The media table defines the location that the MSI will look to find source files during         -->
				<!-- installation or repair scenarios. In this case, the source files are in a cab file that will be -->
				<!-- embedded directly into the MSI at build time.                                                   -->
				<Media Id="1" Cabinet="guava_proj.cab" EmbedCab="yes" />

				<!-- The InstallExecuteSequence table describes the order that actions will be executed during       -->
				<!-- installation, repair and uninstall of this product.                                             -->
				<InstallExecuteSequence>
					<Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts">
						<![CDATA[NEWERVERSIONDETECTED]]>
					</Custom>
					<RemoveExistingProducts After="InstallInitialize" />
					<LaunchConditions After="AppSearch"/>

					<!-- This custom action checks to make sure that at least one of the following conditions is met:             -->
					<!--   1. Visual Studio 2005 is installed and the Visual Basic and/or Visual C# language tools are installed  -->
					<!--   2. Visual Basic 2005 Express Edition is installed                                                      -->
					<!--   3. Visual C# 2005 Express Edition is installed                                                         -->
					<Custom Action="CA_ErrVisualStudio2005NotInstalled" Before="CostInitialize">
						<![CDATA[(NOT(VS2005_INSTALLED AND VS2005_IDE_INSTALLED))]]> 
					</Custom>

					<Custom Action="CA_Devenv_Setup_VS_Install" Before="InstallFinalize">
						<![CDATA[VS2005_IDE_INSTALLED AND NOT REMOVE]]>
					</Custom>
					<Custom Action="CA_Devenv_Setup_VS_Uninstall" Before="CA_Devenv_Setup_VS_Install">
						<![CDATA[VS2005_IDE_INSTALLED AND REMOVE]]>
					</Custom>

				</InstallExecuteSequence>
				<!-- The InstallUISequence table describes the order that actions will be executed when the user     -->
				<!-- runs setup in full UI mode. Some actions must be scheduled in the UI and the execute sequence   -->
				<!-- tables to ensure that they will run regardless of whether the user runs setup in full UI mode   -->
				<!-- or in reduced UI or silent modes. The installation block custom actions are included in both    -->
				<!-- the InstallUISequence and InstallExecuteSequence tables so that they will be executed when the  -->
				<!-- user performs full UI installs and silent installs.                                             -->
				<InstallUISequence>
					<Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts">
						<![CDATA[NEWERVERSIONDETECTED]]>
					</Custom>

					<!-- This custom action checks to make sure that at least one of the following conditions is met:             -->
					<!-- Visual Studio 2005 is installed and the Visual Basic and/or Visual C# language tools are installed  -->
					
					<Custom Action="CA_ErrVisualStudio2005NotInstalled" Before="CostInitialize">
						<![CDATA[(NOT(VS2005_INSTALLED AND VS2005_IDE_INSTALLED))]]> 
					</Custom>
				</InstallUISequence>

				<!-- These properties define links that will appear in the Add/Remove Programs control panel when    -->
				<!-- this product is installed on the system.                                                        -->
				<Property Id="ARPHELPLINK" Value="http://www.microsoft.com/support" />
				<Property Id="ARPURLINFOABOUT" Value="http://www.microsoft.com/support" />

				<!-- This property defines the ALLUSERS property to be 1, which indicates that this product will be  -->
				<!-- installed per-machine instead of per-user.                                                      -->
				<Property Id="ALLUSERS">
					<![CDATA[1]]>
				</Property>

				<!-- Location of the Visual Studio 2005 root installation directory. This is the same value as the   -->
				<!-- directory token defined above so that this installer will work correctly if Visual Studio is    -->
				<!-- installed to a non-default path.                                                                -->
				<Property Id="VS2005_ROOT_FOLDER" Secure="yes">
					<RegistrySearch Id="SearchForVS2005RootPath" Root="HKLM" Key="Software\Microsoft\VisualStudio\SxS\VS7" Name="8.0" Type="raw" />
				</Property>

				<!-- Indicates whether or not some edition of Visual Studio 2005 is installed  -->
				<!-- Does NOT indicate anything more granular about which edition is installed -->
				<Property Id="VS2005_INSTALLED" Secure="yes">
					<ComponentSearch Id="SearchForVsVertIntComponent" Guid="{03F59C6A-202C-4403-9987-349896B7BC84}" Type="file" />
				</Property>

				<!-- Indicates whether the Visual Studio 2005 core IDE component is installed  -->
				<!-- If this property is set, that means Visual Studio 2005 standard or higher -->
				<!-- is installed on the system.                                               -->
				<Property Id="VS2005_IDE_INSTALLED" Secure="yes">
					<ComponentSearch Id="SearchForVsIde2005Component" Guid="{29885AD2-50C6-492A-BF3E-E3F1E3884DFC}" Type="file">
						<FileSearch Id="VsIde2005" Name="devenv.exe"/>
					</ComponentSearch>
				</Property>

				<!-- This UIRef element specifies what WiXUI dialog set to use for the setup UI. This package uses   -->
				<!-- the WixUI_Minimal dialog set, which provides a license agreement page, a progress page and a    -->
				<!-- completion page. Other dialog sets are available in the WiX toolset and are described in more   -->
				<!-- detail in the WiX documentation.                                                                -->
				<UIRef Id="WixUI_Mondo" /> 
				<UIRef Id="WixUI_ErrorProgressText" />

				<!-- These elements define strings that will be displayed on the progress page while setup is        -->
				<!-- executing the specified custom action. This provides the user a better indication of progress   -->
				<!-- during these actions, which is helpful because these actions can take a long time and without   -->
				<!-- this visual indicator, the user might think that setup is hung.                                 -->
				<UI>
					<ProgressText Action="CA_Devenv_Setup_VS_Install" Template="[1]">Updating Visual Studio 2005 registration</ProgressText>
					<ProgressText Action="CA_Devenv_Setup_VS_Uninstall" Template="[1]">Updating Visual Studio 2005 registration</ProgressText>
				</UI>

			</Product>
		</Wix>
	